namespace Cos.Core.NHibernate.Mapping
{
    using FluentNHibernate.Mapping;

    public class UserMap : ClassMap<UserDataModel>
    {
        public UserMap()
        {
            this.Table("Users");
            this.LazyLoad();
            this.Id(x => x.PKID).GeneratedBy.Assigned().Column("PKID");
            this.Map(x => x.Username).Not.Nullable().Column("Username");
            this.Map(x => x.ApplicationName).Not.Nullable().Column("ApplicationName");
            this.Map(x => x.Email).Not.Nullable().Column("Email");
            this.Map(x => x.Comment).Column("Comment");
            this.Map(x => x.Password).Not.Nullable().Column("Password");
            this.Map(x => x.PasswordQuestion).Column("PasswordQuestion");
            this.Map(x => x.PasswordAnswer).Column("PasswordAnswer");
            this.Map(x => x.IsApproved).Column("IsApproved");
            this.Map(x => x.LastActivityDate).Column("LastActivityDate");
            this.Map(x => x.LastLoginDate).Column("LastLoginDate");
            this.Map(x => x.LastPasswordChangeDate).Column("LastPasswordChangeDate");
            this.Map(x => x.CreationDate).Not.Nullable().Column("CreationDate");
            this.Map(x => x.IsOnline).Not.Nullable().Column("IsOnline");
            this.Map(x => x.IsLockedOut).Not.Nullable().Column("IsLockedOut");
            this.Map(x => x.LastLockedOutDate).Column("LastLockedOutDate");
            this.Map(x => x.FailedPasswordAttemptCount).Not.Nullable().Column("FailedPasswordAttemptCount");
            this.Map(x => x.FailedPasswordAttemptWindowStart).Column("FailedPasswordAttemptWindowStart");
            this.Map(x => x.FailedPasswordAnswerAttemptCount).Not.Nullable().Column("FailedPasswordAnswerAttemptCount");
            this.Map(x => x.FailedPasswordAnswerAttemptWindowStart).Column("FailedPasswordAnswerAttemptWindowStart");
        }
    }
}